package org.thinkinbunny.financial.util;




import org.thinkinbunny.financial.activity.MyApplication;

import android.os.Message;
import android.widget.Toast;

public class ShowTools {

	public static Toast toast;
	public static void toast( String notice) {
		if (notice != null && notice.length() > 0) {
			if (toast == null) {
				toast = Toast.makeText(MyApplication.getInstance(), notice, Toast.LENGTH_SHORT);
			} else {
				toast.setText(notice);
			}
			toast.show();
		}
	}
	
	public static void toastInThread( String notice) {
	 Message msg = MyApplication.getInstance().mHandler.obtainMessage(0, 0, 0);
	 msg.obj = notice;
	 MyApplication.getInstance().mHandler.sendMessage(msg);
	}

	public static void toastLong( String notice) {
		if (notice != null && notice.length() > 0) {
			if (toast == null) {
				toast = Toast.makeText(MyApplication.getInstance(), notice, Toast.LENGTH_SHORT);
			} else {
				toast.setText(notice);
			}
			toast.show();
		}
	}
}
